// 
import {request, uploadFile} from './bks.request'

// 文档分类
export const getClassifyTree = (params) => {
  return request({
    url: '/applet/material/applet-anon/classify',
    method: 'get',
    params
  })
}
// 文档分类
export const getClassifyTreeAll = (params) => {
  return request({
    url: '/applet/classify/applet-anon/query/tree',
    method: 'get',
    params
  })
}

// 浏览/收藏专题-资料 
export const datumCollectionView = (params) => {
  return request({
    url: '/applet/material/applet-anon/collection/view',
    method: 'get',
    params
  })
}
// 资料列表
export const datumList = (data) => {
  return request({
    url: '/applet/material/applet-anon/materials',
    method: 'post',
    data
  })
}
// 资料详情 
export const datumDetails = (params) => {
  return request({
    url: '/applet/material/applet-anon/materials/info',
    method: 'get',
    params
  })
}
// 专题列表 
export const topicList = (data) => {
  return request({
    url: '/applet/material/applet-anon/subject',
    method: 'post',
    data
  })
}
// 专题详情
export const topicDetails = (params) => {
  return request({
    url: '/applet/material/applet-anon/subject/info',
    method: 'get',
    params
  })
}
// 我购买的资料列表
export const buyDatumList = (data) => {
  return request({
    url: '/applet/material/buy/materials',
    method: 'post',
    data
  })
}
// 我购买的资料列表
export const buyTopicList = (data) => {
  return request({
    url: '/applet/material/buy/subject',
    method: 'post',
    data
  })
}
// 我收藏的资料列表 
export const collectDatumList = (data) => {
  return request({
    url: '/applet/material/collect/materials',
    method: 'post',
    data
  })
}
// 我收藏的专题列表 
export const collectTopicList = (data) => {
  return request({
    url: '/applet/material/collection/subject',
    method: 'post',
    data
  })
}
// 专题/资料下单(购买专题传专题id资料id可以不传,但购买资料专题id也必须传 后台要判断他是否购买过该专题) 
export const buyDatum = (params) => {
  return request({
    url: '/applet/bksOrder/subject/order',
    method: 'get',
    params,
    loading: '订阅中...'
  })
}
